/*=========================================================================

Program:   Virtual Surgery
Language:  C++
Date:      2009-9-1
Version:   0.1
Mail:		   nelfylee@gmail.com

Copyright (c) 2009 Nelfy Lee. All rights reserved.

=========================================================================*/

#ifndef _PIXEL_GEAR_PANEL_H_
#define _PIXEL_GEAR_PANEL_H_

#include "ControlPanelBase.h"

#include "DisplayModel.h"
#include "Source.h"

class PixelGearPanel : public ControlPanelBase
{
	Q_OBJECT
public:

	PixelGearPanel(QWidget *parent) : ControlPanelBase(parent)
	{
		m_ui.setupUi(this);
		m_panelType = ptPixelGear;

		m_btngroup = new QButtonGroup();

// 		m_btngroup->addButton(m_ui.btn_fd_line, pg::gsLine);
// 		m_btngroup->addButton(m_ui.btn_fd_circle, pg::gsCircle);
// 		m_btngroup->addButton(m_ui.btn_fd_rect, pg::gsRectangle);
// 		m_btngroup->addButton(m_ui.btn_fd_elipse, pg::gsElipse);
// 		m_btngroup->addButton(m_ui.btn_fd_curv, pg::gsCurvature);
// 		m_btngroup->addButton(m_ui.btn_fd_auto, 0);

		m_ui.btn_fd_circle->setChecked(true);

		connect(m_ui.btn_test, SIGNAL(toggled(bool)), SLOT(slotFeatureDetectionTest(bool)));
		connect(m_btngroup, SIGNAL(buttonClicked(int)), SLOT(slotModeChanged(int)));
		connect(m_ui.btn_clear, SIGNAL(clicked()), SLOT(slotClearFDObjects()));
	}

private slots:
	void slotFeatureDetectionTest(bool flag)
	{
			m_displayModel->setPixelGearMode(flag);
			m_displayModel->setPGFeatureDetectionMethod(m_btngroup->checkedId());
	}

	void slotModeChanged(int id)
	{	
		m_displayModel->setPGFeatureDetectionMethod(id);
	}

	void slotClearFDObjects()
	{
		m_displayModel->clearFDObjects();
	}

private:


private:
	Ui::PixelGearPanel m_ui;

	QButtonGroup *m_btngroup;
	//pg::Image *m_pgImage;
};










#endif

